package com.yuan.java.toolsSimpleUseage;

import org.junit.Test;

import java.util.Base64;

/**
 * Created by yeg on 2017/8/10.
 */
public class Base64Util {

    @Test
    public void mains() {
        String name = "你好啊啊啊啊 啊";
        Base64.Encoder encoder = Base64.getEncoder();
        String en = encoder.encodeToString(name.getBytes());
        System.out.println(en);
        System.out.println(new String(Base64.getDecoder().decode(en)));
    }
}
